/*************************************
 * Created by WebStorm
 * Author : 菲尔敦
 * QQ邮箱：2891044172@qq.com  手机号：15981761402
 * Created Time :2024/2/5 18:39
 Desc :
 **************************************/
import {http} from '@/util/http/index.ts'


//登录
export function login(params: any) {
    return http.request(
        {
            url: 'do_login',
            method: 'POST',
            params,
        }
    );
}

//退出登录
export function logout() {
    return http.request({
        url: 'sys/logout',
        method: 'GET',
    });
}

export function getAdminInfo(){
    return http.request({
        url: 'sys/get_info',
        method: 'GET',
    });
}

//更新个人设置中的数据
export function updateAdminInfo(params: any) {
    return http.request(
        {
            url: 'sys/update_login_data',
            method: 'POST',
            params,
        }
    );
}

//修改密码
export function changePassword(params: any) {
    return http.request(
        {
            url: 'sys/change_password',
            method: 'POST',
            params,
        }
    );
}

/**
 * 刷新token
 */

export async function refreshToken() {
    return http.request(
        {
            url: 'sys/refresh_token',
            method: 'GET',
        }
    );
}
